package com.haierp.model;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.IdType;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;

/**
 * 库存变动记录
 * 
 * @author liuhui
 *
 */
public class InventoryRecord implements Serializable {

//	private static final long serialVersionUID = 8275639176094995463L;

	/**
	 * 库存类型
	 * 
	 * @author liuhui
	 *
	 */
	public static enum InventoryType {
		/**
		 * 在途
		 */
		TRANS_INV,
		/**
		 * 实际库存
		 */
		INVENTORY;
	}

	/**
	 * 库存操作类型
	 * 
	 * @author liuhui
	 *
	 */
	public static enum OperatorType {
		/**
		 * 预定
		 */
		LOCKED,
		/**
		 * 发货
		 */
		SEND,
		/**
		 * 进货
		 */
		STOCK;

	}

/*	DROP TABLE IF EXISTS`inventory_record`;
	CREATE TABLE`inventory_record`(
	  `id` bigint(19) NOT NULL AUTO_INCREMENT COMMENT '主键id',
	  `order_id` bigint(19) DEFAULT NULL COMMENT '订单id',
	  `order_detail_id` bigint(19) NOT NULL COMMENT '订单详情id',
	  `item_id` bigint(19) DEFAULT NULL COMMENT '商品id',
	  `sku_id` bigint(19) NOT NULL COMMENT 'skuid',
	  `sku_code` varchar(64) DEFAULT NULL COMMENT 'sku码',
	  `quantity` bigint(11) DEFAULT NULL COMMENT '订单购买量',
	  `booked` bigint(11) DEFAULT NULL COMMENT '预定量',
	  `inventory` bigint(11) DEFAULT NULL COMMENT '实际库存',
	  `inventory_type` varchar(64) DEFAULT NULL COMMENT '库存类型',
	  `operator_type` varchar(64) DEFAULT NULL COMMENT '库存操作类型', 
	  `inventory_area_id` bigint(19) DEFAULT NULL COMMENT '仓库库存id',
	  `warehouse_id` bigint(19) DEFAULT NULL COMMENT '仓库ID',
	  `position_no` varchar(64) DEFAULT NULL COMMENT '货架编号',
	  `gmt_create` datetime NOT NULL COMMENT '创建时间',
	  `gmt_modify` datetime NOT NULL COMMENT '操作时间',

	PRIMARY KEY (`id`)
	) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='库存预定记录';

*/

	/**
	 * 主键id
	 */
	@TableId(type = IdType.AUTO)
	private Long id;
	/**
	 * 订单id
	 */
	@TableField(value = "order_id")
	private Long orderId;
	/**
	 * 订单条目
	 */
	@TableField(value = "erp_order_id")
	private Long erpOrderId;
	/**
	 * 商品id
	 */
	@TableField(value = "item_id")
	private Long itemId;
	/**
	 * skuid
	 */
	@TableField(value = "sku_id")
	private Long skuId;
	/**
	 * skuCode
	 */
	@TableField(value = "sku_code")
	private String skuCode;
	/**
	 * 购买总数量
	 */
	@TableField(value = "quantity")
	private int quantity;

	/**
	 * 已库存预定量
	 */
	@TableField(value = "booked")
	private int booked;
	/**
	 * 预定时的剩余总库存数
	 * 
	 * type = VIRTUAL 虚拟库存量 ， type = INVENTORY 虚拟库存量
	 */
	@TableField(value = "inventory")
	private int inventory;
	/**
	 * 库存类型 : 虚拟/锁定／ 实际
	 */
	@TableField(value = "inventory_type")
	private InventoryType inventoryType;
	/**
	 * 库存操作类型 ： 预定／发货／采购入库
	 */
	@TableField(value = "operator_type")
	private OperatorType operatorType;

	@TableField(value = "inventory_area_id")
	private Long inventoryAreaId;
	/**
	 * 仓库Id
	 */
	@TableField(value = "warehouse_id")
	private Long warehouseId;
	/**
	 * 仓库名称
	 */
	@TableField(exist = false)
	private String warehouseName;
	/**
	 * 货架编号
	 */
	@TableField(value = "position_no")
	private String positionNo;
	// /**
	// * 采购订单号
	// */
	// @TableField(value = "purchase_order_id")
	// private Long purchaseOrderId;
	// /**
	// * 采购条目
	// */
	// @TableField(value = "purchase_order_id")
	// private Long purchaseOrderDetailId;
	/**
	 * 创建时间
	 */
	@TableField(value = "gmt_create")
	private Date gmtCreate;
	/**
	 * 修改时间
	 */
	@TableField(value = "gmt_modify")
	private Date gmtModify;

	//
//	@TableField(value = "is_deleted")
//	private boolean isDeleted;

	// 入库人

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getOrderId() {
		return orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	

	public Long getErpOrderId() {
		return erpOrderId;
	}

	public void setErpOrderId(Long erpOrderId) {
		this.erpOrderId = erpOrderId;
	}

	public Long getSkuId() {
		return skuId;
	}

	public void setSkuId(Long skuId) {
		this.skuId = skuId;
	}

	public String getSkuCode() {
		return skuCode;
	}

	public void setSkuCode(String skuCode) {
		this.skuCode = skuCode;
	}

	public OperatorType getOperatorType() {
		return operatorType;
	}

	public void setOperatorType(OperatorType operatorType) {
		this.operatorType = operatorType;
	}

	public InventoryType getInventoryType() {
		return inventoryType;
	}

	public void setInventoryType(InventoryType inventoryType) {
		this.inventoryType = inventoryType;
	}

	public Long getWarehouseId() {
		return warehouseId;
	}

	public void setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
	}
	public String getWarehouseName() {
		return warehouseName;
	}

	public void setWarehouseName(String warehouseName) {
		this.warehouseName = warehouseName;
	}

	public String getPositionNo() {
		return positionNo;
	}

	public void setPositionNo(String positionNo) {
		this.positionNo = positionNo;
	}

	// public Long getPurchaseOrderId() {
	// return purchaseOrderId;
	// }
	//
	// public void setPurchaseOrderId(Long purchaseOrderId) {
	// this.purchaseOrderId = purchaseOrderId;
	// }
	//
	// public Long getPurchaseOrderDetailId() {
	// return purchaseOrderDetailId;
	// }
	//
	// public void setPurchaseOrderDetailId(Long purchaseOrderDetailId) {
	// this.purchaseOrderDetailId = purchaseOrderDetailId;
	// }

	public Date getGmtCreate() {
		return gmtCreate;
	}

	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	public Date getGmtModify() {
		return gmtModify;
	}

	public void setGmtModify(Date gmtModify) {
		this.gmtModify = gmtModify;
	}

//	public boolean isDeleted() {
//		return isDeleted;
//	}
//
//	public void setDeleted(boolean isDeleted) {
//		this.isDeleted = isDeleted;
//	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public int getBooked() {
		return booked;
	}

	public void setBooked(int booked) {
		this.booked = booked;
	}

	public int getInventory() {
		return inventory;
	}

	public void setInventory(int inventory) {
		this.inventory = inventory;
	}

	public Long getInventoryAreaId() {
		return inventoryAreaId;
	}

	public void setInventoryAreaId(Long inventoryAreaId) {
		this.inventoryAreaId = inventoryAreaId;
	}

	public Long getItemId() {
		return itemId;
	}

	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}

}
